<template>
  <div class="alliance">
    <!-- 顶部横幅 -->
    <div class="banner-container">
      <div class="banner">
        <div class="banner-image">
          <img :src="require('@/assets/alliance/teamwork.png')" alt="团队合作">
        </div>
        <div class="banner-content">
          <h1 class="title">共享！</h1>
          <h2 class="subtitle">加入SHARED-AI推广者联盟！</h2>
          <p class="description">共享智能，共创财富</p>
          <div class="button-wrapper">
            <el-button type="primary" size="large" class="join-button" v-auth-click="handleJoin">
              立即加入
            </el-button>
            <div class="qr-popup">
              <img src="@/assets/info/business-qr.png" alt="联系二维码">
              <p>扫码联系我们</p>
            </div>
          </div>
        </div>
      </div>
    </div>

    <!-- 优势展示 -->
    <div class="benefits">
      <h2 class="section-title">加入《推广者联盟》的好处</h2>
      <div class="benefits-grid">
        <div class="benefit-card">
          <div class="icon">
            <i class="el-icon-money"></i>
          </div>
          <h3>无上限佣金</h3>
          <p>您的推广链接就是财富密码！每笔成功交易，都为您锁定丰厚佣金，收益无上限，潜力即财富。</p>
          <img src="@/assets/alliance/unlimited-commission.png" alt="无上限佣金" class="benefit-image">
        </div>
        <div class="benefit-card">
          <div class="icon">
            <i class="el-icon-data-line"></i>
          </div>
          <h3>持续收益</h3>
          <p>推广无忧，收益不愁！用户续费或复购，您拿佣金，持续进账；提现零手续费，真金白银，简单实在。</p>
          <img src="@/assets/alliance/ongoing-revenue.png" alt="持续收益" class="benefit-image">
        </div>
        <div class="benefit-card">
          <div class="icon">
            <i class="el-icon-help"></i>
          </div>
          <h3>专业支持</h3>
          <p>全程贴心陪伴，专属服务助力！您将拥有私人商务顾问，一对一解决难题，全程无忧。</p>
          <img src="@/assets/alliance/professional-support.png" alt="专业支持" class="benefit-image">
        </div>
        <div class="benefit-card">
          <div class="icon">
            <i class="el-icon-share"></i>
          </div>
          <h3>推广简单</h3>
          <p>轻松一触，链接即刻生成，分享即获客，推广从未如此简单。</p>
          <img src="@/assets/alliance/easy-promotion.png" alt="推广简单" class="benefit-image">
        </div>
      </div>
    </div>

    <!-- 合作伙伴渠道 -->
    <div class="channels">
      <h2 class="section-title">联盟者计划合作伙伴及渠道</h2>
      <p class="subtitle">欢迎各类渠道伙伴加入我们的联盟计划</p>
      
      <div class="channels-grid">
        <div class="channel-card">
          <div class="channel-image">
            <img src="@/assets/alliance/digital-content-creator.png" alt="数字内容创作者">
          </div>
          <div class="card-content">
            <h3>数字内容创作者</h3>
            <p>通过您的社交媒体平台、视频或直播，分享SHARED-AI的专属链接，吸引粉丝订阅。</p>
          </div>
        </div>
        
        <div class="channel-card">
          <div class="channel-image">
            <img src="@/assets/alliance/educational-institution.png" alt="教育机构">
          </div>
          <div class="card-content">
            <h3>教育机构</h3>
            <p>在课程介绍、教学资料或资源分享中嵌入SHARED-AI服务，为学生和教职工提供更丰富的学习资源。</p>
          </div>
        </div>
        
        <div class="channel-card">
          <div class="channel-image">
            <img src="@/assets/alliance/corporate-institution.png" alt="企业机构">
          </div>
          <div class="card-content">
            <h3>企业机构</h3>
            <p>适合各类企业和组织机构，通过AI智能服务提升工作效率，为团队创造更多可能性。</p>
          </div>
        </div>
        
        <div class="channel-card">
          <div class="channel-image">
            <img src="@/assets/alliance/community-platform.png" alt="社区平台">
          </div>
          <div class="card-content">
            <h3>社区平台</h3>
            <p>通过在活跃的论坛或在线社区分享您的经验和专属链接，可以帮助用户发现AI创作的价值，建立良好的交流与分享氛围。</p>
          </div>
        </div>
        
        <div class="channel-card">
          <div class="channel-image">
            <img src="@/assets/alliance/community-group.png" alt="社群群组">
          </div>
          <div class="card-content">
            <h3>社群群组</h3>
            <p>在您各类兴趣社群、学习群组分析专属链接，让AI智能创作服务惠及更多志同道合的伙伴。</p>
          </div>
        </div>
        
        <div class="channel-card">
          <div class="channel-image">
            <img src="@/assets/alliance/content-platform.png" alt="内容平台">
          </div>
          <div class="card-content">
            <h3>内容平台</h3>
            <p>欢迎各类博客、自媒体平台加入，用专业的内容建设，展现AI智能创作的无限可能。</p>
          </div>
        </div>
      </div>
    </div>

    <!-- 加入流程 -->
    <div class="join-process">
      <h2 class="section-title">加入流程</h2>
      <p class="subtitle">无需额外操作，专属客服搞定一切</p>

      <div class="process-steps">
        <div class="step">
          <div class="step-image">
            <img src="@/assets/alliance/contact.png" alt="联系我们">
          </div>
          <div class="step-number">1</div>
          <h3>联系我们</h3>
          <p>添加工作人员</p>
        </div>
        <div class="step-arrow">→</div>
        <div class="step">
          <div class="step-image">
            <img src="@/assets/alliance/apply.png" alt="进行申请">
          </div>
          <div class="step-number">2</div>
          <h3>进行申请</h3>
          <p>提供推广渠道信息</p>
        </div>
        <div class="step-arrow">→</div>
        <div class="step">
          <div class="step-image">
            <img src="@/assets/alliance/promote.png" alt="开始推广">
          </div>
          <div class="step-number">3</div>
          <h3>开始推广</h3>
          <p>获取专属链接开始推广</p>
        </div>
      </div>
    </div>

    <!-- 常见问题 -->
    <div class="faq">
      <h2 class="section-title">常见问题</h2>
      <div class="faq-content">
        <el-collapse v-model="activeNames">
          <el-collapse-item 
            v-for="(item, index) in faqItems" 
            :key="index"
            :title="item.question" 
            :name="String(index + 1)"
          >
            <p>{{ item.answer }}</p>
          </el-collapse-item>
        </el-collapse>
      </div>
    </div>

    <!-- 在常见问题模块后添加 -->
    <div class="join-now">
      <h2 class="join-title">开启您的SHARED-AI推广者联盟之旅</h2>
      <p class="join-subtitle">分享您的专属链接，每次推荐即可赚取收益</p>
      <div class="button-container">
        <div class="button-wrapper">
          <el-button type="primary" size="large" class="join-now-button" v-auth-click="handleJoin">
            立即开始赚钱
          </el-button>
          <div class="qr-popup">
            <img src="@/assets/info/business-qr.png" alt="联系二维码">
            <p>扫码联系我们</p>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'AllianceView',
  data() {
    return {
      activeNames: null,
      // 常见问题列表
      faqItems: [
        {
          question: '如何获取佣金？',
          answer: '推广成功后，用户通过您的专属链接购买产品，您将获得订单金额的佣金返利。'
        },
        {
          question: '佣金如何结算？',
          answer: '佣金将在订单完成后自动结算，可随时提现到您的支付宝或银行卡。'
        },
        {
          question: '需要什么条件才能加入？',
          answer: '需要您拥有稳定的流量渠道，如个人网站、公众号、短视频账号等。'
        },
        {
          question: '推广链接有效期是多久？',
          answer: '推广链接长期有效，无使用期限。'
        },
        {
          question: '佣金比例是多少？',
          answer: '根据不同产品，佣金比例在15%-30%之间，具体以实际结算为准。'
        }
      ]
    }
  },
  methods: {
    handleJoin() {
      // 处理加入按钮点击事件
      this.$message({
        message: '正在开发中，敬请期待！',
        type: 'success'
      })
    }
  }
}
</script>

<style scoped>
.alliance {
  min-height: 100vh;
}

/* 美观的分割线样式 */
.fancy-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 0;
  width: 100%;
  background: #f8f9fa;
}

.divider-line {
  height: 1px;
  background: linear-gradient(to right, rgba(63, 93, 98, 0.1), rgba(63, 93, 98, 0.5), rgba(63, 93, 98, 0.1));
  flex-grow: 1;
  margin: 0 15px;
  max-width: 300px;
}

.divider-icon {
  color: #3F5D62;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 2px 10px rgba(63, 93, 98, 0.15);
  position: relative;
  z-index: 1;
  transition: all 0.3s ease;
}

.divider-icon:hover {
  transform: rotate(180deg);
  box-shadow: 0 4px 15px rgba(63, 93, 98, 0.25);
}

.banner-container {
  background: #F8F9FA;
  padding: 40px 20px;
  display: flex;
  justify-content: center;
  width: 100%;
}

.banner {
  background: white;
  max-width: 1200px;
  width: 100%;
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  border-radius: 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.banner-image {
  flex: 1;
  max-width: 500px;
}

.banner-image img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  opacity: 1;
}

.banner-content {
  flex: 1;
  color: #3F5D62;
  text-align: left;
  max-width: 500px;
}

.title {
  font-size: 3rem;
  margin-bottom: 20px;
  font-weight: bold;
}

.join-process .subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 50px;
  font-size: 1.2rem;
}

.description {
  font-size: 1.2rem;
  margin-bottom: 40px;
  opacity: 0.9;
}

.join-button {
  padding: 15px 40px;
  font-size: 1.2rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #3F5D62, #87CEEB);
  border: none;
  color: white;
  transition: all 0.3s;
}

.join-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(63, 93, 98, 0.2);
}

.benefits {
  padding: 60px 20px;
  background: #f8f9fa;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 40px;
  color: #333;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
}

.benefit-card {
  background: white;
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: all 0.3s;
  overflow: hidden;
}

.benefit-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(63, 93, 98, 0.15);
}

.benefit-image {
  width: 100%;
  height: auto;
  max-width: 100%;
  margin-top: 20px;
  border-radius: 8px;
}

.icon {
  font-size: 2.5rem;
  color: #3F5D62;
  margin-bottom: 20px;
}

.benefit-card h3 {
  margin: 15px 0;
  color: #333;
}

.benefit-card p {
  color: #666;
  line-height: 1.6;
  margin-bottom: 20px;
}

.channels {
  padding: 60px 20px;
  background: #f8f9fa;
}

.channels .subtitle {
  text-align: center;
  color: #666;
  margin-bottom: 50px;
  font-size: 1.2rem;
}

.channels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.channel-card {
  position: relative;
  height: 240px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  transition: all 0.3s;
}

.channel-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 20px rgba(63, 93, 98, 0.15);
}

.channel-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.channel-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  transition: all 0.3s;
}

.channel-card:hover .channel-image img {
  opacity: 0.4;
  transform: scale(1.05);
}

.card-content {
  position: relative;
  z-index: 2;
  padding: 30px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.1),
    rgba(0, 0, 0, 0.2)
  );
}

.card-content h3 {
  font-size: 1.6rem;
  color: #fff;
  margin-bottom: 15px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.card-content p {
  color: #fff;
  font-size: 1rem;
  line-height: 1.6;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.join-process {
  padding: 60px 20px;
  background: #f8f9fa;
}

.process-steps {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
}

.step {
  text-align: center;
  padding: 20px;
  flex: 1;
  min-width: 200px;
}

.step-image {
  width: 160px;
  height: 160px;
  margin: 0 auto 20px;
  border-radius: 10px;
  overflow: hidden;
}

.step-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.step:hover .step-image img {
  transform: scale(1.05);
}

.step-number {
  width: 40px;
  height: 40px;
  background: #3F5D62;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-weight: bold;
}

.step-arrow {
  font-size: 2rem;
  color: #3F5D62;
  margin: 0 20px;
}

.faq {
  padding: 60px 20px;
  background: #f8f9fa;
  position: relative;
}

.faq::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(to right, rgba(63, 93, 98, 0.1), rgba(63, 93, 98, 0.8), rgba(63, 93, 98, 0.1));
  border-radius: 3px;
}

.faq-content {
  max-width: 900px;
  margin: 0 auto;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* 自定义 Element UI 折叠面板样式 */
.faq-content /deep/ .el-collapse {
  border: none;
}

.faq-content /deep/ .el-collapse-item__header {
  padding: 20px 25px;
  font-size: 1.1rem;
  color: #333;
  font-weight: 500;
  border-bottom: 1px solid #f0f0f0;
  transition: all 0.3s;
}

.faq-content /deep/ .el-collapse-item__header:hover {
  background: #f9f9f9;
  color: #3F5D62;
}

.faq-content /deep/ .el-collapse-item__arrow {
  margin-right: 10px;
  color: #3F5D62;
  font-size: 16px;
  transition: transform 0.3s;
}

.faq-content /deep/ .el-collapse-item__content {
  padding: 15px 25px 25px;
}

.faq-content /deep/ .el-collapse-item__wrap {
  border-bottom: none;
}

.faq-content /deep/ .el-collapse-item:last-child .el-collapse-item__header {
  border-bottom: none;
}

.faq-content /deep/ p {
  color: #666;
  line-height: 1.8;
  margin: 0;
  font-size: 1rem;
}

/* 添加问题前的图标 */
.faq-content /deep/ .el-collapse-item__header:before {
  content: "Q";
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  background: #3F5D62;
  color: white;
  border-radius: 50%;
  margin-right: 15px;
  font-weight: bold;
  font-size: 0.9rem;
}

/* 添加回答前的图标 */
.faq-content /deep/ p:before {
  content: "A";
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  background: #e6a23c;
  color: white;
  border-radius: 50%;
  margin-right: 15px;
  font-weight: bold;
  font-size: 0.9rem;
  vertical-align: top;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .faq {
    padding: 40px 15px;
  }
  
  .faq-content /deep/ .el-collapse-item__header {
    padding: 15px 20px;
    font-size: 1rem;
  }
  
  .faq-content /deep/ .el-collapse-item__content {
    padding: 10px 20px 20px;
  }
  
  .faq-content /deep/ .el-collapse-item__header:before,
  .faq-content /deep/ p:before {
    width: 24px;
    height: 24px;
    line-height: 24px;
    font-size: 0.8rem;
    margin-right: 10px;
  }
}

.join-now {
  padding: 80px 20px;
  background: #f8f9fa;
  text-align: center;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.join-title {
  font-size: 2rem;
  color: #333;
  margin-bottom: 20px;
}

.join-subtitle {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.join-now-button {
  padding: 15px 40px;
  font-size: 1.2rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #3F5D62, #87CEEB);
  border: none;
  color: white;
  transition: all 0.3s;
}

.join-now-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(63, 93, 98, 0.2);
  opacity: 0.9;
}

.button-wrapper {
  position: relative;
  display: inline-block;
}

.qr-popup {
  position: absolute;
  bottom: calc(100% + 20px); /* 在按钮上方20px */
  left: 50%;
  transform: translateX(-50%) scale(0);
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

.qr-popup::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 16px;
  height: 16px;
  background: white;
  box-shadow: 4px 4px 5px rgba(0, 0, 0, 0.05);
}

.qr-popup img {
  width: 150px;
  height: 150px;
  display: block;
  margin-bottom: 10px;
}

.qr-popup p {
  margin: 0;
  color: #666;
  font-size: 14px;
  text-align: center;
}

.button-wrapper:hover .qr-popup {
  transform: translateX(-50%) scale(1);
  opacity: 1;
}

/* 确保二维码弹窗在按钮上方 */
.join-button,
.join-now-button {
  position: relative;
  z-index: 1;
}

@media (max-width: 768px) {
  .banner {
    flex-direction: column;
    text-align: center;
    padding: 30px 20px;
  }

  .banner-content {
    text-align: center;
  }
  
  .title {
    font-size: 2rem;
  }
  
  .subtitle {
    font-size: 1.5rem;
  }
  
  .process-steps {
    flex-direction: column;
  }
  
  .step-arrow {
    transform: rotate(90deg);
    margin: 20px 0;
  }

  .channels-grid {
    grid-template-columns: 1fr;
  }
  
  .channel-card {
    max-width: 400px;
    margin: 0 auto;
  }
}

/* 为了让相邻的浅色背景区域有所区分，可以添加一个微妙的分隔线 */
.channels,
.join-process,
.faq {
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}
</style> 